This page last changed on Oct 24, 2008 by straha1.
Does Not Work

The instructions on this page tell you how to use the IDL virtual machine on the cluster nodes. These instructions do not work because it is not possible to run the IDL virtual machine on the cluster nodes. If you want to use IDL, you will have to do it without the virtual machine. Follow these instructions instead:

Running IDL on HPC

You cannot run the IDL virtual machine on the cluster nodes because the IDL virtual machine refuses to start unless it has access to an X11 Server. It will not run the program until it displays its splash screen and the user clicks on the splash screen. When a job runs on a cluster node, there is no X11 and no user to do the clicking.

This is always the case with the standard IDL virtual machine that comes on an IDL CD, but it is possible to purchase a special IDL license that allows one to run the virtual machine without the splash screen. That is mentioned on the ITTVis website for the IDL Virtual Machine in this paragraph:

The IDL VM can be used for both commercial and non-commercial applications. In cases when a developer does not wish the IDL VM splash screen to appear, when IDL is tightly integrated with other software applications or software environments, or when a developer wishes to license an application to customers with the IDL environment, ITT offers additional distribution models and licensing options tailored to the needs of the software developer.

We do not have such a license, so you will have to use regular old IDL to run your IDL programs.

Performing Calculations on the Cluster Nodes

When you run IDL on the cluster nodes, you are going to need to use the IDL Virtual Machine, not the normal IDL executable. The reason for this is that you need a license to run the normal IDL executable, but we have fewer licenses than compute nodes. The IDL Virtual machine cannot compile .pro files – you have to give it pre-compiled files. Thus we are going to create a IDL .sav file which will contain all of the functions that your program requires, all pre-compiled. Then we will use the IDL Virtual Machine on a cluster node to run the program.

This tutorial will use the following IDL files. First, sayhello.pro:

; sayhello.pro
pro sayhello,what
  print,'HELLO',what
end

and also, main.idl:

pro main
  sayhello,'WORLD'
end

Step 1: Create Your IDL .sav File

In order to create the IDL save file, you have to run the regular idl executable. IDL is installed on the head node hpc.rs.umbc.edu, so we'll run it there. Log in to hpc.rs.umbc.edu and cd to the directory that contains the sayhello.pro and main.idl files. Next you need to start idl. Unfortunately, the idl program is not in your path on hpc by default, so to start it you will need to type the full path to the program:

/asl/opt/rsi/idl/bin/idl

which should start IDL and give you the familiar "IDL>" prompt. Now we need to compile the top-level program main by running .compile main.pro:

IDL> .compile main.pro
% Compiled module: MAIN.

IDL will need all of the procedures and functions that you need to run your program, not just the top-level one. We're going to use the resolve_all procedure to automatically compile all of the other routines that you need:

IDL> resolve_all
% Compiled module: RESOLVE_ALL.
% Compiled module: SAYHELLO.
% Compiled module: PATH_SEP.
% Compiled module: UNIQ.

The resolve_all command compiled the sayhello procedure for us, and also compiled resolve_all itself and all of resolve_all's prerequisites. If sayhello called a dozen other functions, resolve_all would have compiled those too. Now we need to save the compiled code into a .sav file:

IDL> save,file='prog.sav',/routines

The \/routines flag tells IDL to save all routines that have been compiled thus far into the prog.sav file. Note that you cannot put routines and variables in the same file. If you want to save variables as well, you will have to create a second .sav file.

Let's check and make sure IDL added everything we needed to the prog.sav file. To do this, first quit IDL and start it again:

IDL> exit
username@hpc:~> /asl/opt/rsi/idl/bin/idl
IDL> 

At the IDL> prompt, ask IDL to load prog.sav:

IDL> restore,'prog.sav',/verbose
% RESTORE: Portable (XDR) SAVE/RESTORE file.
% RESTORE: Save file written by straha1@hpc.cl.rs.umbc.edu, Thu Oct 23
           23:30:35 2008.
% RESTORE: IDL version 7.0 (linux, x86_64).
% RESTORE: Restored procedure: MAIN.
% RESTORE: Restored procedure: RESOLVE_ALL.
% RESTORE: Restored procedure: RESOLVE_ALL_CLASS.
% RESTORE: Restored procedure: SAYHELLO.
% RESTORE: Restored function: PATH_SEP.
% RESTORE: Restored function: RESOLVE_ALL_BODY.
% RESTORE: Restored function: UNIQ.

The restore command loaded everything in the prog.sav file and listed everything that it was loading. Note that it has loaded our MAIN and SAYHELLO procedures, along with everything resolve_all needed. Now, let's test the main program just to make sure it works:

IDL> main
HELLOWORLD

Apparently it does work, so quit IDL and go to the next section to learn how to run your program on the cluster.

Note

Do not run large programs on the head node to test them – only do this for very simple test cases. The head node has multiple users so your programs will slow down everyone else's work. Also, everyone's jobs on the head node take up memory (RAM) and you will probably have less memory available to your job on the head node than on the cluster nodes.

Step 2: Run the IDL Virtual Machine on the Cluster Nodes

Running IDL is much like running other serial jobs. We need to make a few simple modifications to the qsub scripts used elsewhere. We'll create sayhello.qsub which will contain:

#!/bin/bash
: The above line tells Linux to use the shell /bin/bash to execute
: this script.  That must be the first line in the script.

: You must have no lines beginning with # before these
: PBS lines other than the /bin/bash line:
#PBS -N 'hello_parallel'
#PBS -o 'qsub.out'
#PBS -e 'qsub.err'
#PBS -W umask=007
#PBS -q low_priority
#PBS -l nodes=1:ppn=4
#PBS -m bea

: Change the current working directory to the directory from which you ran qsub:
cd $PBS_O_WORKDIR

/asl/opt/rsi/idl/bin/idl -vt=prog.sav

As always, submit the script using qsub:

qsub sayhello.qsub

Eventually your job should complete and produce qsub.out and qsub.err. The qsub.out file should contain "HELLO WORLD". It won't though. Instead, it will abort and tell you that it cannot find the X display. The reason is that the IDL Virtual Machine will not run your program until you click on a button on the IDL Virtual Machine splash screen. Since there is no X11 to display the splash screen on, and no user to click any button, the splash screen portion of the program aborts and your job does not run.

Document generated by Confluence on Mar 31, 2011 15:37